import "reflect-metadata"; // 引入reflect-metadata原数据


export const reqProcess = (method: string) => {
  return (reqPath: string)=>{
    return (target: any, methodname: any, methodDecri: any) => {
      // 将数据存储到target的原型上
      // 创建一个名为path的数据，保存到target原型对象上的methodname上
      Reflect.defineMetadata("path", reqPath, target, methodname);
      // 创建一个名为methodType的数据，保存到target原型对象上的methodname上
      Reflect.defineMetadata("methodType", method, target, methodname);      
      
      
    }
  }
}



const get = reqProcess("get");
const patch = reqProcess("patch");
const post = reqProcess("post");
const put = reqProcess("put");
const del = reqProcess("delete");

export { get, post, put, del, patch };
